var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var ResKeeper = require("AA_ResKeeper");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;
_decorator.inspector;
var _def_UnLockLight = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.selfMask = null;
    t.lightNode = null;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype.StartSet = function (e, t, o) {
    var n = this;
    this.selfMask.node.width = e.width;
    this.selfMask.node.height = e.height;
    if (t) {
      this.selfMask.spriteFrame = t;
      this.selfMask.type = cc.Mask.Type.IMAGE_STENCIL;
    } else {
      this.selfMask.type = cc.Mask.Type.RECT;
    }
    var i = Math.floor(2 * e.width / 1200);
    i < 1 && (i = 1);
    this.lightNode.stopAllActions();
    this.lightNode.x = -e.width;
    this.lightNode.runAction(cc.sequence(cc.repeat(cc.sequence(cc.moveTo(i, e.width, 0), cc.callFunc(function () {
      n.lightNode.x = -e.width;
    })), o), cc.callFunc(function () {
      n.node.destroy();
    })));
  };
  __decorate([_property(cc.Mask)], _creator.prototype, "selfMask", undefined);
  __decorate([_property(cc.Node)], _creator.prototype, "lightNode", undefined);
  return __decorate([_ccclass], _creator);
}(ResKeeper.default);
exports.default = _def_UnLockLight;